include Makefile.param

ONVIF = y
TARGET = onvif_server
SRCS := $(GSOAP)/stdsoap2.c $(CUSTOM)/duration.c
SRCS += soapC.c soapServer.c

ifeq ($(ONVIF),y)
SRCS += $(wildcard services/*.c)
SRCS += onvif.c save_configs.c
else
SRCS += soapTester.c
endif

OBJS := $(SRCS:%.c=%.o)
LIBS_FLAGS = -lpthread

all: $(TARGET)

$(TARGET):$(OBJS)
	$(CC) $(CFLAGS) -o $@ $^ $(INC_PATH) $(LIBS_FLAGS) 
	
$(OBJS):  %.o:%.c
	$(CC) $(CFLAGS) -o $@ -c $< $(INC_PATH)

clean:
	@rm -f $(OBJS) $(TARGET) *.o

# remove all auto-generated files,imported or copied files
dist-clean:
	@rm -f $(OBJS) $(TARGET) *.o
	#rm -f *.nsmap soap*.c soap*.h duration.c stdsoap2.c typemap.dat 
	#rm -f *.wsdl *.xsd

.PHONY:clean all dist-clean

